<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>匿名函数</title>
<script type="text/javascript">
window.onload=function(){
	document.getElementById("btn").onclick=function(){
		var count=prompt("请输入计算的数:");
		alert(count+"的平方值是："+count*count);
	}		
}
</script>
</head>
<body>
	<input type="button" name="btn" id="btn" value="计算数的平方值"/>
</body>
</html>